package com.qf.bootdaily.entity;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName daily
 */
@Data
public class Daily implements Serializable {
    /**
     * 主键id
     */
    private Integer id;

    /**
     * 日报名字
     */
    private String dailyName;

    /**
     * 日报内容
     */
    private String dailyContent;

    /**
     * 日报日期
     */
    private Date register;

    /**
     * 那个用户的日报
     */
    private Integer userId;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Daily other = (Daily) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDailyName() == null ? other.getDailyName() == null : this.getDailyName().equals(other.getDailyName()))
            && (this.getDailyContent() == null ? other.getDailyContent() == null : this.getDailyContent().equals(other.getDailyContent()))
            && (this.getRegister() == null ? other.getRegister() == null : this.getRegister().equals(other.getRegister()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDailyName() == null) ? 0 : getDailyName().hashCode());
        result = prime * result + ((getDailyContent() == null) ? 0 : getDailyContent().hashCode());
        result = prime * result + ((getRegister() == null) ? 0 : getRegister().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", dailyName=").append(dailyName);
        sb.append(", dailyContent=").append(dailyContent);
        sb.append(", register=").append(register);
        sb.append(", userId=").append(userId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}